<!DOCTYPE HTML>
<html>
	 <head>
		<meta http-equiv="content-type" content="text/html;charset=utf-8">
		<title>订单详情</title>
		<script src="__JQ__/jquery.js"></script>
		<link rel="stylesheet" href="__JQ__/jqueryUI/jquery-ui.theme.min.css">
		<script src="__JQ__/jqueryUI/jquery-ui.min.js"></script>
		<script type="text/javascript" src="__JQ__/admin-js.js"></script>
		<style>.msg{background-color:#1C86EE;width:200px;height:30px;position:absolute;left:50%;margin-left:-100px;border-radius:8px;display:none;color:white}
		</style>
		<script>
		$(function() {
			setTimeout("changeDivStyle();", 100); // 0.1秒后展示结果，因为HTML加载顺序，先加载脚本+样式，再加载body内容。所以加个延时
		});
		function changeDivStyle(){
			var o_status = $("#o_status").val();	//获取隐藏框值
			if(o_status==0){
				$('#create').css('background', '#DD0000');
				$('#createText').css('color', '#DD0000');
			}else if(o_status==1||o_status==2){
				$('#check').css('background', '#DD0000');
				$('#checkText').css('color', '#DD0000');
			}else if(o_status==4){
				$('#delivery').css('background', '#DD0000');
				$('#deliveryText').css('color', '#DD0000');
			}else if(o_status==3){
				$('#pay').css('background', '#DD0000');
				$('#pay').css('color', '#DD0000');
			}else if(o_status==5){
				$('#received').css('background', '#DD0000');
				$('#receivedText').css('color', '#DD0000');
			}else if(o_status==6){
				$('#cancel').css('background', '#DD0000');
				$('#cancelText').css('color', '#DD0000');
			}
			
		}
		</script>
		<style type="text/css">
		*{list-style-type:none;}
		a,img{border:0;}
		.stepInfo{background:#f2f2f2;font:12px/180% Arial, Helvetica, sans-serif, "新宋体";}
		.stepInfo{position:relative;margin-bottom:30px;background:#f2f2f2;margin:20px auto 0 auto;width:800px;}
		.stepInfo li{float:left;width:48%;height:0.15em;background:#bbb;}
		.stepIco{border-radius:1em;padding:0.03em;background:#bbb;text-align:center;line-height:1.5em;color:#fff; position:absolute;width:1.4em;height:1.4em;}
		.stepIco1{top:-0.7em;left:30%;}
		.stepIco2{top:-0.7em;left:40%;}
		.stepIco3{top:-0.7em;left:50%;}
		.stepIco4{top:-0.7em;left:60%;}
		.stepIco5{top:-0.7em;left:70%;}
		.stepIco6{top:-0.7em;left:80%;}
		.stepText{color:#666;margin-top:0.2em;width:4em;text-align:center;margin-left:-1.4em;}
		</style>
	</head>
<body>
<div class="msg" align="center"></div>
		<input type="hidden" value="<{$vo.ordnow}>" id="o_status" />
			<div class="stepInfo">
				<ul>
					<li></li>
					<li></li>
				</ul>
				<div class="stepIco stepIco1" id="create">1
					<div class="stepText" id="createText">创建订单</div>
				</div>
				<div class="stepIco stepIco2" id="check">2
					<div class="stepText" id="checkText">审核订单</div>
				</div>
				<div class="stepIco stepIco3" id="pay">3
					<div class="stepText" id="payText">付款</div>
				</div>
				<div class="stepIco stepIco4" id="delivery">4
					<div class="stepText" id="deliveryText">发货</div>
				</div>
				<div class="stepIco stepIco5" id="received">5
					<div class="stepText" id="receivedText">完成</div>
				</div>
				<div class="stepIco stepIco6" id="cancel">6
					<div class="stepText" id="cancelText">关闭</div>
				</div>
			</div>
		<div class="container">
	<!-- main框架顶部 -->	
		<!--订单列表-->
		<!-- 订单详情列表表单 -->
			<div id="tanchu1" style="border:4px solid #999; background-color:#FFF;" >
				<div style="line-height:25px;  font-size:16px;padding-left:40px;padding-bottom:10px;padding-top:10px;">
				
					订单状态：（<font color="red">
									<switch name="vo.ordnow">    
										<case value="1">等待卖家确认</case>    
										<case value="2">等待买家付款</case>
										<case value="3">等待卖家发货</case>    
										<case value="4">卖家已发货</case>
										<case value="5">交易完成</case>    
										<case value="6">交易关闭</case>
									</switch></font>）
					<br/>创建时间：<{$vo.ordtime|date="Y-m-d H:i:s",###}>
					<br/>下单会员：<{$vo.uname}>（电话：<{$vo.moblie}>）
					<br/>支付方式：<if condition="$vo.payway eq 1">支付宝付款<elseif condition="$vo.payway eq 2">货到付款<else/>网银付款</if>
					<br/>备注内容：<{$vo.content}>
					<if condition="$vo.ordnow eq 3"><br/>配送方式：<input type="text" name="express" value=""></if>    
					<if condition="$vo.ordnow eq 3"><br/>快递单号：<input type="text" name="expid" value=""></if>
					<if condition="$vo.ordnow gt 3"><br/>配送方式：<{$vo.express}></if>    
					<if condition="$vo.ordnow gt 3"><br/>快递单号：<{$vo.expid}></if>
					<br/>待收货人：<{$vo.person}>（手机：<{$vo.moblie}>&nbsp;固话：<{$vo.tel}>）
					<br/>详细地址：<{$vo.xxaddress}>
				</div>
			</div>
			<form method="post" action="" name="listForm" > 
				<table class="list_table" id="listtable" width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CFCFCF" align="center" style="margin-top:8px">
					<thead>				 
						<tr align="center" bgcolor="#FBFCE2" height="25">
							<th class="pname" width="18%">商品名称<img src="__IMAGE__/sort_desc.gif"/></th>
							<th class="color-size" width="12%">商品货号</th>
							<th class="color-size" width="12%">颜色/尺寸</th>
							<th class="buyprice" width="10%">优惠价格</th>
							<th class="buyprice" width="10%">购买单价</th>
							<th class="buynum" width="8%">购买数量</th>
							<th class="size_num" width="8%">剩余库存</th>
						</tr>
					</thead>
					
				   <tbody>
				   <foreach name="pro" item="v">
					<tr onMouseOver="this.style.background='#FFCC66'" onMouseOut="this.style.background='#fff';" bgcolor="#CCCCCC" >
						<td align="center" valign="middle" class="pname" width="15%"><{$v.goods_name}></td>
						<td align="center" class="pid"><{$v.pid}></td>
						<td align="center" class="color-size"><{$v.goods_color}>&nbsp;<{$v.goods_size}></td>
						<td align="center" class="name"><span class="sprice">0</span></td>
						<td align="center" class="name"><span class="buyprice"><{$v.goods_price}></span></td>
						<td align="center" class="buynum"><span class="buynum"><{$v.goods_num}></span></td>
						<td align="center" class="onsale"><span class="p_num"><font style="color:red"><{$v['goods_pnum']-$v['goods_num']}></a></span></td>
					</tr>
					</foreach>
				   </tbody> 
				</table>
				<div><br></div>
				<div id="tanchu1" style="border:1px solid #999; background-color:#FFF;" >  
					<div style="line-height:25px; font-size:16px;padding-left:80%;padding-bottom:10px;padding-top:10px;">订单总金额：￥（<font color="blue"><{$vo.money}></font>）<br/>应付总金额：￥<font color="red"><b><{$vo.money}></b></font>       
					</div>
				</div>
				<div style="float:right;line-height:25px; padding-left:60px;padding-bottom:10px;padding-top:10px;">
				  <input type="hidden" name="orderid" value=""/>
				  <input type="hidden" name="ordernow" value=""/>
					<switch name="vo.ordnow">    
						<case value="1">
							<button type="button" style="width:100px;margin-left:30px;border:none;font-size:16px;cursor:pointer;" name="queren" id="queren" data-id="<{$vo.ordid}>">确认订单</button>
							<button type="button" style="width:100px;margin-left:30px;border:none;font-size:16px;cursor:pointer;" name="quxiao" id="quxiao" data-id="<{$vo.ordid}>">取消订单</button>
						</case>    
						<case value="2">
							<button type="button" style="width:100px;margin-left:30px;border:none;font-size:16px;cursor:pointer;" name="quxiao" id="quxiao" data-id="<{$vo.ordid}>">取消订单</button>
						</case>
						<case value="3">
							<button type="button" style="width:100px;margin-left:30px;border:none;font-size:16px;cursor:pointer;" name="fahuo" id="fahuo" data-id="<{$vo.ordid}>">发货</button>
						</case>
					</switch>
				</div>
			</form>			  
		</div>
		
	</div>



	<script>

	function refresh(){
		window.location.reload();				 
	}
	
	$("[name=quxiao]").click(function(){
		var ordid = $(this).attr("data-id");
		$.get("<{:U('ordQx')}>",{ordid:ordid},function(data){
			if(data.status){				
				$('.msg').text(data.msg);
				$('.msg').slideDown('fast');
				setTimeout(function(){$('.msg').slideUp('fast');},1600);
				
				}			
			},'json');
			refresh();
		});


	$("[name=fahuo]").click(function(){
		var ordid = $(this).attr("data-id");
		var express = $("[name=express]").val();
		var expid = $("[name=expid]").val();
		console.log(express);
		$.get("<{:U('ordFh')}>",{ordid:ordid,express:express,expid:expid},function(data){
			if(data.status){				
				$('.msg').text(data.msg);
				$('.msg').slideDown('fast');
				setTimeout(function(){$('.msg').slideUp('fast');},1600);
				
				}			
			},'json');
			refresh();
		});
	
	$("[name=queren]").click(function(){
		var ordid = $(this).attr("data-id");
		$.get("<{:U('ordQr')}>",{ordid:ordid},function(data){
			if(data.status){				
				$('.msg').text(data.msg);
				$('.msg').slideDown('fast');
				setTimeout(function(){$('.msg').slideUp('fast');},1600);
				
				}			
			},'json');
			refresh();
		});
	
	</script>
</body>
<html>

